package langnstats.project;

import java.io.File;
import java.io.IOException;

import langnstats.project.lib.LanguageModel;
import langnstats.project.lib.WordType;
import langnstats.project.lib.crossvalidation.TrainTokens;

public class Trainer {
	
	
	public static void main(String[] args) throws IOException{
		if(args.length<2){ throw new IllegalArgumentException("There must be more than 2 arguments! Current argument # = " + args.length); }
		File trainFile = new File(args[0]);
		
		/* TODO */
		LanguageModel model = null;
		
		WordType[] tokens = WordType.parse(trainFile);
		TrainTokens tt = new TrainTokens(tokens);
		model.train( tt );
		File modelFile = new File(args[1]);
		Global.save(model, modelFile);		
	}

}
